
package com.city.project.service.impl;

import com.city.project.factory.DaoFactory;
import com.city.project.model.User;
import com.city.project.service.IUserService;

import java.util.List;

public class UserServiceImpl implements IUserService {
    @Override
    public User getUserByUserName(String userName) {
        return DaoFactory.getUserDao().getByName(userName);
    }

    @Override
    public List<User> getList() {
        return DaoFactory.getUserDao().getList();
    }

    @Override
    public User getOne(int id) {
        return DaoFactory.getUserDao().getOne(id);
    }

    @Override
    public int insert(User user) {
        DaoFactory.getUserDao().insert(user);
        return 0;
    }

    @Override
    public int delete(int id) {
        DaoFactory.getUserDao().delete(id);
        return 0;
    }

    @Override
    public int update(User user) {
        DaoFactory.getUserDao().update(user);
        return 0;
    }

}
